package com.jic.manager.controller.manage.jobmanagement;

import com.jic.common.base.vo.PageResult;
import com.jic.common.base.vo.RestResult;
import com.jic.manager.entity.JobManagement;
import com.jic.manager.request.JobManagementRequest;
import com.jic.manager.response.JobManagementResponse;
import com.jic.manager.service.JobManagementService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("jobManagement")
public class JobManagemenController {
    @Autowired
    private JobManagementService jobManagementService;
    //查询岗位列表
    @PostMapping(value = "/getJobList")
    public RestResult<PageResult<JobManagementResponse>> getJobList(@RequestBody JobManagementRequest jobManagementRequest)  {
        PageResult<JobManagementResponse> jobManagementVoList  = jobManagementService.getJobList(jobManagementRequest);
        return RestResult.success(jobManagementVoList);
    }

    //修改岗位信息
    @PostMapping(value = "/editJobInfo")
    public RestResult<String> editJobInfo(@RequestBody JobManagementRequest jobManagementRequest){
        return jobManagementService.editJobInfo(jobManagementRequest);
    }

    //删除岗位信息
    @PostMapping(value = "deleteJobInfo")
    public RestResult<String> deleteDept(@RequestBody JobManagementRequest jobManagementRequest){
        return jobManagementService.deleteJobInfo(jobManagementRequest);
    }
}
